(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 8.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       157,          7]
NotebookDataLength[     17079,        550]
NotebookOptionsPosition[     15948,        506]
NotebookOutlinePosition[     16346,        523]
CellTagsIndexPosition[     16303,        520]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[
 RowBox[{"Needs", "[", "\"\<VariationalMethods`\>\"", "]"}]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ds2", "=", 
  RowBox[{
   RowBox[{
    SuperscriptBox["c", "2"], " ", 
    RowBox[{"(", 
     RowBox[{"1", "-", " ", 
      FractionBox["Rs", "r"]}], ")"}], " ", 
    SuperscriptBox[
     RowBox[{"Dt", "[", "t", "]"}], "2"]}], "-", 
   RowBox[{
    FractionBox["1", 
     RowBox[{"1", "-", 
      FractionBox["Rs", "r"]}]], 
    SuperscriptBox[
     RowBox[{"Dt", "[", "r", "]"}], "2"]}], " ", "-", " ", 
   RowBox[{
    SuperscriptBox["r", "2"], 
    SuperscriptBox[
     RowBox[{"Dt", "[", "\[Phi]", "]"}], "2"]}]}]}]], "Input",
 CellChangeTimes->{{3.6183682771067753`*^9, 3.618368280671979*^9}, {
  3.6183683421674967`*^9, 3.618368511770197*^9}}],

Cell[BoxData[
 FormBox[
  RowBox[{
   RowBox[{
    SuperscriptBox["c", "2"], " ", 
    RowBox[{"(", 
     RowBox[{"1", "-", 
      FractionBox["Rs", "r"]}], ")"}], " ", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       TagBox["\[DifferentialD]",
        Dt], "t"}], ")"}], "2"]}], "-", 
   RowBox[{
    SuperscriptBox["r", "2"], " ", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       TagBox["\[DifferentialD]",
        Dt], "\[Phi]"}], ")"}], "2"]}], "-", 
   FractionBox[
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       TagBox["\[DifferentialD]",
        Dt], "r"}], ")"}], "2"], 
    RowBox[{"1", "-", 
     FractionBox["Rs", "r"]}]]}], TraditionalForm]], "Output",
 CellChangeTimes->{3.6183685385257273`*^9, 3.6183704064655676`*^9, 
  3.6183706283142567`*^9, 3.6183710277341022`*^9, 3.618374196108323*^9, 
  3.6183879567513866`*^9, 3.6184452555032463`*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"Rs", "=", 
   FractionBox[
    RowBox[{"2", "G", " ", "m"}], 
    SuperscriptBox["c", "2"]]}], ";", 
  RowBox[{"Clear", "[", "Rs", "]"}]}]], "Input",
 CellChangeTimes->{{3.6183686159651566`*^9, 3.618368637033362*^9}, {
  3.618370634297599*^9, 3.6183706346416187`*^9}, {3.6183710304242563`*^9, 
  3.618371087168502*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"schwarzschildLagrangian", "=", 
  RowBox[{
   RowBox[{
    SuperscriptBox["c", "2"], " ", 
    RowBox[{"(", " ", 
     RowBox[{"1", "-", " ", 
      FractionBox["Rs", 
       RowBox[{"r", "[", "s", "]"}]]}], ")"}], " ", 
    SuperscriptBox[
     RowBox[{"(", " ", 
      RowBox[{
       SubscriptBox["\[PartialD]", "s"], 
       RowBox[{"t", "[", "s", "]"}]}], ")"}], "2"]}], "-", 
   FractionBox[
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       SubscriptBox["\[PartialD]", "s"], 
       RowBox[{"r", "[", "s", "]"}]}], ")"}], "2"], 
    RowBox[{"1", "-", 
     FractionBox["Rs", 
      RowBox[{"r", "[", "s", "]"}]]}]], "-", 
   RowBox[{
    FractionBox["1", "2"], 
    SuperscriptBox[
     RowBox[{"r", "[", "s", "]"}], 
     RowBox[{"2", " "}]], 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       SubscriptBox["\[PartialD]", "s"], 
       RowBox[{"\[Phi]", "[", "s", "]"}]}], ")"}], "2"]}]}]}]], "Input",
 CellChangeTimes->{{3.618368658770605*^9, 3.618368675959588*^9}, {
  3.6183687079614186`*^9, 3.618368737692119*^9}, {3.6183687864359074`*^9, 
  3.61836890659578*^9}}],

Cell[BoxData[
 FormBox[
  RowBox[{
   RowBox[{
    SuperscriptBox["c", "2"], " ", 
    RowBox[{"(", 
     RowBox[{"1", "-", 
      FractionBox["Rs", 
       RowBox[{"r", "(", "s", ")"}]]}], ")"}], " ", 
    SuperscriptBox[
     RowBox[{
      SuperscriptBox["t", "\[Prime]",
       MultilineFunction->None], "(", "s", ")"}], "2"]}], "-", 
   FractionBox[
    SuperscriptBox[
     RowBox[{
      SuperscriptBox["r", "\[Prime]",
       MultilineFunction->None], "(", "s", ")"}], "2"], 
    RowBox[{"1", "-", 
     FractionBox["Rs", 
      RowBox[{"r", "(", "s", ")"}]]}]], "-", 
   RowBox[{
    FractionBox["1", "2"], " ", 
    SuperscriptBox[
     RowBox[{"r", "(", "s", ")"}], "2"], " ", 
    SuperscriptBox[
     RowBox[{
      SuperscriptBox["\[Phi]", "\[Prime]",
       MultilineFunction->None], "(", "s", ")"}], "2"]}]}], 
  TraditionalForm]], "Output",
 CellChangeTimes->{
  3.6183689090409193`*^9, 3.618370412735926*^9, 3.6183706381228175`*^9, 
   3.618371059604925*^9, {3.618371096922059*^9, 3.618371111915917*^9}, 
   3.618374198477458*^9, 3.6183879595925493`*^9, 3.6184452586704273`*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"swEquations", " ", "=", " ", 
   RowBox[{"EulerEquations", "[", 
    RowBox[{"schwarzschildLagrangian", ",", " ", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"r", "[", "s", "]"}], ",", " ", 
       RowBox[{"\[Phi]", "[", "s", "]"}], ",", " ", 
       RowBox[{"t", "[", "s", "]"}]}], " ", "}"}], ",", " ", "s"}], "]"}]}], 
  ";", " ", 
  RowBox[{"swEquations", " ", "//", "TableForm"}]}]], "Input",
 CellChangeTimes->{{3.6183690207793107`*^9, 3.6183690559563227`*^9}, {
  3.618370390177636*^9, 3.6183703916727214`*^9}, {3.61837042433659*^9, 
  3.6183704367292986`*^9}, {3.618370508684414*^9, 3.618370534177872*^9}}],

Cell[BoxData[
 FormBox[
  TagBox[
   TagBox[GridBox[{
      {
       RowBox[{
        RowBox[{
         FractionBox[
          RowBox[{
           SuperscriptBox["c", "2"], " ", "Rs", " ", 
           SuperscriptBox[
            RowBox[{
             SuperscriptBox["t", "\[Prime]",
              MultilineFunction->None], "(", "s", ")"}], "2"]}], 
          SuperscriptBox[
           RowBox[{"r", "(", "s", ")"}], "2"]], "+", 
         RowBox[{
          RowBox[{"r", "(", "s", ")"}], " ", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"-", 
             FractionBox[
              RowBox[{"2", " ", 
               RowBox[{
                SuperscriptBox["r", "\[Prime]\[Prime]",
                 MultilineFunction->None], "(", "s", ")"}]}], 
              RowBox[{"Rs", "-", 
               RowBox[{"r", "(", "s", ")"}]}]]}], "-", 
            SuperscriptBox[
             RowBox[{
              SuperscriptBox["\[Phi]", "\[Prime]",
               MultilineFunction->None], "(", "s", ")"}], "2"]}], ")"}]}], 
         "-", 
         FractionBox[
          RowBox[{"Rs", " ", 
           SuperscriptBox[
            RowBox[{
             SuperscriptBox["r", "\[Prime]",
              MultilineFunction->None], "(", "s", ")"}], "2"]}], 
          SuperscriptBox[
           RowBox[{"(", 
            RowBox[{"Rs", "-", 
             RowBox[{"r", "(", "s", ")"}]}], ")"}], "2"]]}], "\[LongEqual]", 
        "0"}]},
      {
       RowBox[{
        RowBox[{
         RowBox[{"r", "(", "s", ")"}], " ", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"2", " ", 
            RowBox[{
             SuperscriptBox["r", "\[Prime]",
              MultilineFunction->None], "(", "s", ")"}], " ", 
            RowBox[{
             SuperscriptBox["\[Phi]", "\[Prime]",
              MultilineFunction->None], "(", "s", ")"}]}], "+", 
           RowBox[{
            RowBox[{"r", "(", "s", ")"}], " ", 
            RowBox[{
             SuperscriptBox["\[Phi]", "\[Prime]\[Prime]",
              MultilineFunction->None], "(", "s", ")"}]}]}], ")"}]}], 
        "\[LongEqual]", "0"}]},
      {
       RowBox[{
        RowBox[{"-", 
         FractionBox[
          RowBox[{"2", " ", 
           SuperscriptBox["c", "2"], " ", 
           RowBox[{"(", 
            RowBox[{
             RowBox[{"Rs", " ", 
              RowBox[{
               SuperscriptBox["r", "\[Prime]",
                MultilineFunction->None], "(", "s", ")"}], " ", 
              RowBox[{
               SuperscriptBox["t", "\[Prime]",
                MultilineFunction->None], "(", "s", ")"}]}], "+", 
             RowBox[{
              RowBox[{"r", "(", "s", ")"}], " ", 
              RowBox[{"(", 
               RowBox[{
                RowBox[{"r", "(", "s", ")"}], "-", "Rs"}], ")"}], " ", 
              RowBox[{
               SuperscriptBox["t", "\[Prime]\[Prime]",
                MultilineFunction->None], "(", "s", ")"}]}]}], ")"}]}], 
          SuperscriptBox[
           RowBox[{"r", "(", "s", ")"}], "2"]]}], "\[LongEqual]", "0"}]}
     },
     GridBoxAlignment->{
      "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, 
       "RowsIndexed" -> {}},
     GridBoxSpacings->{"Columns" -> {
         Offset[0.27999999999999997`], {
          Offset[0.5599999999999999]}, 
         Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
         Offset[0.2], {
          Offset[0.4]}, 
         Offset[0.2]}, "RowsIndexed" -> {}}],
    Column],
   Function[BoxForm`e$, 
    TableForm[BoxForm`e$]]], TraditionalForm]], "Output",
 CellChangeTimes->{
  3.6183690569333787`*^9, {3.6183703924787674`*^9, 3.6183704379023657`*^9}, {
   3.618370515056779*^9, 3.6183705350369215`*^9}, 3.618370640524955*^9, {
   3.6183710989961777`*^9, 3.6183711136710176`*^9}, 3.618374200339565*^9, 
   3.6183879629967437`*^9, 3.618445260682543*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"angularMomentum", " ", "=", " ", 
  RowBox[{
   RowBox[{
    RowBox[{"(", 
     RowBox[{
      RowBox[{"(", 
       RowBox[{
        RowBox[{"Integrate", "[", 
         RowBox[{"#1", ",", " ", "s"}], "]"}], " ", "&"}], ")"}], " ", "/@", 
      " ", 
      RowBox[{"{", 
       RowBox[{"swEquations", "[", 
        RowBox[{"[", 
         RowBox[{"2", ",", "1"}], "]"}], "]"}], "}"}]}], "  ", ")"}], "[", 
    RowBox[{"[", "1", "]"}], "]"}], " ", "\[Equal]", " ", 
   FractionBox["1", 
    SqrtBox["\[Beta]"]]}]}]], "Input",
 CellChangeTimes->{{3.618370675978983*^9, 3.6183707611498547`*^9}, {
  3.6183709113304443`*^9, 3.6183709401550927`*^9}}],

Cell[BoxData[
 FormBox[
  RowBox[{
   RowBox[{
    SuperscriptBox[
     RowBox[{"r", "(", "s", ")"}], "2"], " ", 
    RowBox[{
     SuperscriptBox["\[Phi]", "\[Prime]",
      MultilineFunction->None], "(", "s", ")"}]}], "\[LongEqual]", 
   FractionBox["1", 
    SqrtBox["\[Beta]"]]}], TraditionalForm]], "Output",
 CellChangeTimes->{3.618370941013142*^9, 3.6183711161601596`*^9, 
  3.6183742026056943`*^9, 3.6183879646558385`*^9, 3.6184452631566844`*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"swEquations", "[", 
  RowBox[{"[", 
   RowBox[{"2", ",", "1"}], "]"}], "]"}]], "Input",
 CellChangeTimes->{{3.618374233369454*^9, 3.6183742554497166`*^9}}],

Cell[BoxData[
 FormBox[
  RowBox[{
   RowBox[{"r", "(", "s", ")"}], " ", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"2", " ", 
      RowBox[{
       SuperscriptBox["r", "\[Prime]",
        MultilineFunction->None], "(", "s", ")"}], " ", 
      RowBox[{
       SuperscriptBox["\[Phi]", "\[Prime]",
        MultilineFunction->None], "(", "s", ")"}]}], "+", 
     RowBox[{
      RowBox[{"r", "(", "s", ")"}], " ", 
      RowBox[{
       SuperscriptBox["\[Phi]", "\[Prime]\[Prime]",
        MultilineFunction->None], "(", "s", ")"}]}]}], ")"}]}], 
  TraditionalForm]], "Output",
 CellChangeTimes->{{3.6183742362466183`*^9, 3.618374255977747*^9}, 
   3.618387966296932*^9, 3.6184452641167393`*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData["swEquations"], "Input"],

Cell[BoxData[
 FormBox[
  RowBox[{"{", 
   RowBox[{
    RowBox[{
     RowBox[{
      FractionBox[
       RowBox[{
        SuperscriptBox["c", "2"], " ", "Rs", " ", 
        SuperscriptBox[
         RowBox[{
          SuperscriptBox["t", "\[Prime]",
           MultilineFunction->None], "(", "s", ")"}], "2"]}], 
       SuperscriptBox[
        RowBox[{"r", "(", "s", ")"}], "2"]], "+", 
      RowBox[{
       RowBox[{"r", "(", "s", ")"}], " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", 
          FractionBox[
           RowBox[{"2", " ", 
            RowBox[{
             SuperscriptBox["r", "\[Prime]\[Prime]",
              MultilineFunction->None], "(", "s", ")"}]}], 
           RowBox[{"Rs", "-", 
            RowBox[{"r", "(", "s", ")"}]}]]}], "-", 
         SuperscriptBox[
          RowBox[{
           SuperscriptBox["\[Phi]", "\[Prime]",
            MultilineFunction->None], "(", "s", ")"}], "2"]}], ")"}]}], "-", 
      FractionBox[
       RowBox[{"Rs", " ", 
        SuperscriptBox[
         RowBox[{
          SuperscriptBox["r", "\[Prime]",
           MultilineFunction->None], "(", "s", ")"}], "2"]}], 
       SuperscriptBox[
        RowBox[{"(", 
         RowBox[{"Rs", "-", 
          RowBox[{"r", "(", "s", ")"}]}], ")"}], "2"]]}], "\[LongEqual]", 
     "0"}], ",", 
    RowBox[{
     RowBox[{
      RowBox[{"r", "(", "s", ")"}], " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"2", " ", 
         RowBox[{
          SuperscriptBox["r", "\[Prime]",
           MultilineFunction->None], "(", "s", ")"}], " ", 
         RowBox[{
          SuperscriptBox["\[Phi]", "\[Prime]",
           MultilineFunction->None], "(", "s", ")"}]}], "+", 
        RowBox[{
         RowBox[{"r", "(", "s", ")"}], " ", 
         RowBox[{
          SuperscriptBox["\[Phi]", "\[Prime]\[Prime]",
           MultilineFunction->None], "(", "s", ")"}]}]}], ")"}]}], 
     "\[LongEqual]", "0"}], ",", 
    RowBox[{
     RowBox[{"-", 
      FractionBox[
       RowBox[{"2", " ", 
        SuperscriptBox["c", "2"], " ", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{"Rs", " ", 
           RowBox[{
            SuperscriptBox["r", "\[Prime]",
             MultilineFunction->None], "(", "s", ")"}], " ", 
           RowBox[{
            SuperscriptBox["t", "\[Prime]",
             MultilineFunction->None], "(", "s", ")"}]}], "+", 
          RowBox[{
           RowBox[{"r", "(", "s", ")"}], " ", 
           RowBox[{"(", 
            RowBox[{
             RowBox[{"r", "(", "s", ")"}], "-", "Rs"}], ")"}], " ", 
           RowBox[{
            SuperscriptBox["t", "\[Prime]\[Prime]",
             MultilineFunction->None], "(", "s", ")"}]}]}], ")"}]}], 
       SuperscriptBox[
        RowBox[{"r", "(", "s", ")"}], "2"]]}], "\[LongEqual]", "0"}]}], "}"}],
   TraditionalForm]], "Output",
 CellChangeTimes->{{3.6183879508980513`*^9, 3.618387967916025*^9}, 
   3.6184452658308372`*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"energy", " ", "=", " ", 
  RowBox[{
   RowBox[{
    RowBox[{"MapAt", "[", " ", 
     RowBox[{
      RowBox[{
       RowBox[{"Integrate", "[", 
        RowBox[{"#", ",", " ", "s"}], "]"}], "&"}], ",", " ", 
      RowBox[{"{", 
       RowBox[{"swEquations", "[", 
        RowBox[{"[", 
         RowBox[{"3", ",", " ", "1"}], "]"}], "]"}], "}"}], ",", " ", "1"}], 
     "]"}], "[", 
    RowBox[{"[", "1", "]"}], "]"}], " ", "\[Equal]", " ", 
   RowBox[{"-", " ", 
    FractionBox[
     SuperscriptBox["k", "2"], 
     RowBox[{
      SuperscriptBox["c", "2"], 
      SqrtBox["\[Beta]"]}]]}]}]}]], "Input",
 CellChangeTimes->{{3.6183877713727837`*^9, 3.6183878540485125`*^9}, {
  3.618387910393735*^9, 3.6183879335480595`*^9}}],

Cell[BoxData[
 FormBox[
  RowBox[{
   RowBox[{"-", 
    FractionBox[
     RowBox[{"2", " ", 
      SuperscriptBox["c", "2"], " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"r", "(", "s", ")"}], "-", "Rs"}], ")"}], " ", 
      RowBox[{
       SuperscriptBox["t", "\[Prime]",
        MultilineFunction->None], "(", "s", ")"}]}], 
     RowBox[{"r", "(", "s", ")"}]]}], "\[LongEqual]", 
   RowBox[{"-", 
    FractionBox[
     SuperscriptBox["k", "2"], 
     RowBox[{
      SqrtBox["\[Beta]"], " ", 
      SuperscriptBox["c", "2"]}]]}]}], TraditionalForm]], "Output",
 CellChangeTimes->{3.6183879372832727`*^9, 3.618387971573234*^9, 
  3.6184452678779545`*^9}]
}, Open  ]]
},
WindowSize->{1664, 968},
WindowMargins->{{-7, Automatic}, {Automatic, 10}},
CellContext->Notebook,
Magnification:>2.3 Inherited,
FrontEndVersion->"8.0 for Microsoft Windows (64-bit) (November 7, 2010)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[557, 20, 84, 1, 65, "Input"],
Cell[CellGroupData[{
Cell[666, 25, 673, 21, 125, "Input"],
Cell[1342, 48, 896, 30, 155, "Output"]
}, Open  ]],
Cell[2253, 81, 354, 9, 106, "Input"],
Cell[CellGroupData[{
Cell[2632, 94, 1122, 35, 136, "Input"],
Cell[3757, 131, 1096, 33, 158, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[4890, 169, 655, 14, 105, "Input"],
Cell[5548, 185, 3867, 106, 231, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[9452, 296, 667, 19, 116, "Input"],
Cell[10122, 317, 454, 12, 141, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[10613, 334, 179, 4, 65, "Input"],
Cell[10795, 340, 693, 20, 96, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[11525, 365, 37, 0, 65, "Input"],
Cell[11565, 367, 2915, 86, 238, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[14517, 458, 746, 22, 123, "Input"],
Cell[15266, 482, 666, 21, 147, "Output"]
}, Open  ]]
}
]
*)

(* End of internal cache information *)
